﻿using System.Configuration;

namespace Fuse8.ContentManagementFramework.Web.Etc.PagePresent.Configuration
{
    public static class CmsPagePresenterConfigurationManager
    {
        private static CmsPagePresentersConfigurationSection pagePresenters;
        public static bool ConfigurationRead {get; private set; }

        public static CmsPagePresentersConfigurationSection PagePresenters
        {
            get
            {
                if (pagePresenters == null && !ConfigurationRead)
                {
                    pagePresenters = ConfigurationManager.GetSection("fuse8.cmf/pagePresenters") as CmsPagePresentersConfigurationSection;                    
                    ConfigurationRead = true;
                }

                return pagePresenters;
            }
        }
    }
}